<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script>
	function Score(mid, kor,eng){
		this.mid = mid;
		this.kor = kor;
		this.eng= eng;
		this.tot = 0;
		this.avg = 0;
		
		this.compute = function(){
			this.tot = this.kor + this.eng;
			this.avg = this.tot/2;
		}
		
		this.getTot = function(){ return this.tot;}
		this.getAvg = function(){ return this.avg;}
		
	}
	
	var array = new Array();
	var s1 = new Score("kim",90,50);
	var s2 = new Score("jun",70,46);
	
	s1.compute();
	s2.compute();
	
	array.push(s1);
	array.push(s2);
	
	for(i = 0; i<array.length; i++){
		document.write(array[i].mid + "<br>");
		document.write(array[i].getTot() + "<br>");
		document.write(array[i].getAvg() + "<p>");
	}
</script>
</body>
</html>